<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsp/jstl/functions"%>

<h3>Add a new friend</h3>
	<div class="sideControlGroup">
	<p><a href="${baseUrl}/friends/user/find">Click here to search new friends</a></p>
	</div>

<h3>Filter on name</h3>
	<div class="sideControlGroup">
	<form action="${baseUrl}/friends" method="get">
		<p>
			<input class="cleanInput" type="text" name="search" size="26" value="${search}" />
			<input type="submit" value="find" class="submit" />
		</p>
		<c:if test="${!empty search}">
			<a href="${baseUrl}/friends">clear search</a>
		</c:if>
	</form>
	</div>

<h3>Display options</h3>

<h4>Status</h4>
	<div class="sideControlGroup">
	<p>
		<c:url var="statusActive" value="/friends">
		</c:url>
		<c:url var="statusClocked" value="/friends">
			<c:param name="status" value="blocked" />
		</c:url>
		<c:url var="statusIncomingReq" value="/friends">
			<c:param name="status" value="pendingincoming" />
		</c:url>
		<c:url var="statusOutgoingReq" value="/friends">
			<c:param name="status" value="pendingoutgoing" />
		</c:url>
		
		<c:choose>
			<c:when test="${empty status || status eq 'active'}"><span class="controlActive">active</span></c:when>
			<c:otherwise><a href="${statusActive}">active</a></c:otherwise>
		</c:choose>
		<br/>
		
		<c:choose>
			<c:when test="${!empty status && status eq 'blocked'}"><span class="controlActive">blocked friends</span></c:when>
			<c:otherwise><a href="${statusClocked}">blocked friends</a></c:otherwise>
		</c:choose>
		<br/>
</p>
</div>

<h4>Pending requests</h4>
	<div class="sideControlGroup">
	<p>
		<c:choose>
			<c:when test="${!empty status && status eq 'pendingincoming'}"><span class="controlActive">incoming</span></c:when>
			<c:otherwise><a href="${statusIncomingReq}">incoming</a></c:otherwise>
		</c:choose>
		<br/>
		
		<c:choose>
			<c:when test="${!empty status && status eq 'pendingoutgoing'}"><span class="controlActive">outgoing</span></c:when>
			<c:otherwise><a href="${statusOutgoingReq}">outgoing</a></c:otherwise>
		</c:choose>
		<br/>
	</p>
	</div>